package huoye.shops.huoye.mine.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.codeideology.android.widget.recycler.RecyclerViewAdapter;

import butterknife.BindView;
import huoye.shops.R;
import huoye.shops.base.APIUrls;
import huoye.shops.huoye.mine.model.detialsImg;
import huoye.shops.huoye.operation.model.ManageEventData;
import huoye.shops.huoye.user.model.User;
import huoye.shops.widget.RoundImageView;


/**
 * Created by uesr on 2018/8/10.
 */

public class ShopMessageDetialsAdapter extends RecyclerViewAdapter<ShopMessageDetialsAdapter.ViewHolder,detialsImg> {


    public ShopMessageDetialsAdapter(Context context) {
        super(context, R.layout.item_shop_message_detials);
    }

    @Override
    protected ViewHolder initViewHolder(View view, int i) {

        return new ViewHolder(view);
    }

    @Override
    protected void bindView(ViewHolder holder, detialsImg detials, int i) {

        if(getContext() != null){
            Glide.with(getContext())
                    .load(APIUrls.COMMON_CONFIG.TYPE_COMMON_ALIYUN+detials.getImgUrl())
                    .centerCrop()
                    .placeholder(R.mipmap.ic_wait_logo_big)
                    .error(R.mipmap.ic_wait_logo_big)
                    .into(holder.rv);
        }

        holder.tv.setText(detials.getImgDes());
    }


    public class ViewHolder extends RecyclerViewAdapter.ViewHolder {

        @BindView(R.id.item_shop_message_detials_rv)
        RoundImageView rv;
        @BindView(R.id.item_shop_message_detials_tv)
        TextView tv;






        public ViewHolder(View itemView) {
            super(itemView);
        }
    }




}
